home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 24
/
AMIGAplus Sonderheft 24 (2000)(Falke)(DE)[!].iso
/
PublicDomain
/
Anwendungen
/
MCControl
/
Modules
/
Modules.doc
< prev
next >
Wrap
Text File
|
2000-01-01
|
13KB
|
338 lines
;----------------------------------------------------------------------------
; $VER: MCControlModule.Doc 1.40 (19.02.2000)
;----------------------------------------------------------------------------
;This is not an documentation how to use the .mcm modules in your own
;software! Its an documentation about how to write modules for other
;card reader.
;----------------------------------------------------------------------------
TABLE OF CONTENTS
MCControlModule/General
MCControlModule/Module_Info
MCControlModule/Module_Open
MCControlModule/Module_Close
MCControlModule/Module_AccessDirectFrame
MCControlModule/Module_AccessDirectPage
MCControlModule/Module_AccessRawFrame
MCControlModule/Module_AccessRawPage
;----------------------------------------------------------------------------
First the main structure:
Module_Identifier = "MCCM"
Module_VersionNumber = 1
RSRESET
Module_Code rs.w 1 ;MUST $4e75 (RTS)
Module_Version rs.w 1 ;Must be Module_VersionNumber
Module_ID rs.l 1 ;Must be "MCCM"
Module_Flags rs.l 1 ;see below (unused flags must be zero)
Module_Exec_Base rs.l 1 ;Filled by MCControl
Module_Dos_Base rs.l 1 ;Filled by MCControl
Module_Intuition_Base rs.l 1 ;Filled by MCControl
;--- Card Data
Module_Reserved1 rs.l 14 ;Reserved (must be ZERO)
;--- Jump Table
Module_Info rs.w 3
Module_Open rs.w 3
Module_Close rs.w 3
Module_ReservedFunctions2 rs.w 3*7 ;Reserved
Module_AccessDirectFrame rs.w 3
Module_AccessDirectPage rs.w 3
Module_AccessRawFrame rs.w 3
Module_AccessRawPage rs.w 3
Module_ReservedFunctions3 rs.w 3*6 ;reserved
Module_SIZEOF rs.b 0
;----------------------------------------------------------------------------
;--- Enable transfer routines:
BITDEF Module,AccessDirectFrame,3 ;Driver supports DirectFrameAccess
BITDEF Module,AccessDirectPage,7 ;Driver supports DirectPageAccess
BITDEF Module,AccessRawFrame,6 ;Driver supports RawFrameAccess
BITDEF Module,AccessRawPage,8 ;Driver supports RawPageAccess
;--- Enable gadgets within the settings window:
BITDEF Module,ConfigMultiPage,5 ;Driver requires MultiPage setup
BITDEF Module,Reserved2,0 ;Must be Zero
BITDEF Module,ConfigDevice,1 ;Driver requires an Device/Unit selector
;--- Enable special functions:
BITDEF Module,EnableMultiPage,2 ;Turn on MultiPage support
BITDEF Module,EnableMultiSlot,4 ;Turn on MultiSlot support
BITDEF Module,EnableModuleInfo,9 ;Turn on ModuleInfo support
;----------------------------------------------------------------------------
Module_Error_NoError = 0
Module_Error_OpenDevice = 1 ;Opening the given device fails!
Module_Error_NotCompatible = 2 ;If hardware supports identification!
Module_Error_NoTimerDevice = 3 ;If you need the timer.device and opening fails
Module_Error_NoParallelPort= 4 ;No ParallelPort resource
Module_Error_NoResources = 5 ;Use for missing signals, CIA Interrupts,...
Module_Error_OutOfMemory = 20
;----------------------------------------------------------------------------
;--- For AccessDirectFrame (Mode)
Module_AccessDirect_Read = 0
Module_AccessDirect_Write = 1
;--- For AccessDirectPage (Mode)
Module_AccessDirect_Up = 0
Module_AccessDirect_Down = 1
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
NOTES
The exec, dos and intuition bases are for free usage. This saves
memory, time and of cource code size. The card data is for free usage,
too.
Beside the arguments delivered for each function you´ll receive an
pointer on the module itself in register A4!
Make sure to backup a2-a5 and d2-d7 just like the Amiga-OS is doing!
You must implement port and device allocation! Don´t try to play with
the hardware without owning the right to do so. If possible try to use
parallel.device or serial.device. (The user defined device will be
given during Module_Open().
It´s not required to create an real jumptable, by using JMPs. Feel
free, to use an BRA followed by an NOP. (See RamCard.mcm)
Implement the code as fast as possible, because its used for many times
during reading and writing memory cards. Try to avoid overhead by using
Module_Open.
If you need help then ask me and I´am telling you what to do. If you
don´t know how to code a driver then send me your information and I´ll
do my very best.
;----------------------------------------------------------------------------
;----------------------------------------------------------------------------
MCControlModule/Module_Info
NAME
Module_Info -- open and inits the module
SYNOPSIS
Error = Module_Info(Buffer, BufferSize)
D0 a0, d0
(ULONG) = Module_Open(*UBYTE, ULONG)
FUNCTION
Give MCControl special information about your driver,
the hardware version detected or something like that.
INPUTS
Buffer: Destination buffer for your message
BufferSize: Size of the destinaton buffer! Make sure you
don´t write more than these numbe of bytes!
RESULT
0 = No Error
Other results are currently not allowed!!
NOTES
Please support this routine! Even if there isn´t any
important to say, then just report the version strings
like shown in the example sources.
Buffer is garanted to be 100 bytes at minimum. If you are
not sure your routine may create longer strings, then use
BufferSize to not step over boundaries. The visible gadget
space isn´t very big, so take an eye on this, too!
This function requires the flag: ModuleF_EnableModuleInfo!
Otherwise MCControl is ignoring this routine.
SEE ALSO
Module_Close()
;----------------------------------------------------------------------------
MCControlModule/Module_Open
NAME
Module_Open -- open and inits the module
SYNOPSIS
Error = Module_Open(Device, Unit)
D0 a0, d0
(ULONG) = Module_Open(*UBYTE,ULONG)
FUNCTION
Open the required device and alloc additional memory
if needed.
INPUTS
Device: Pointer on device name (STRING IS READ ONLY!!!)
Unit: Unit of the given device
RESULT
0 = No Error
1 = Open device error
2 = Not compatible
3 = time.device open error
4 = No parallel resource
5 = No resources (no signals, CIA interrupts)
20 = Out of memory
Other results are currently not allowed!!
NOTES
Device and Unit are only valid if the ModuleF_ConfigDevice
flag within the module structure (Module_Flags) is set.
SEE ALSO
Module_Close()
;----------------------------------------------------------------------------
MCControlModule/Module_Close
NAME
Module_Close -- free all data and close all devices.
SYNOPSIS
Module_Close()
FUNCTION
Close all devices and free all allocated memory .
NOTES
Module_Close must be save to be called more than
one time. This means you must detect an closing of
an just closed module. In this case you must return
without any action.
SEE ALSO
Module_Open()
;----------------------------------------------------------------------------
MCControlModule/Module_AccessDirectFrame
NAME
Module_AccessDirectFrame -- Handles a